package com.neo.controller.law;

import cn.shuibo.annotation.Decrypt;
import cn.shuibo.annotation.Encrypt;
import com.neo.bean.LawEnforcement;
import com.neo.common.base.Base2Controller;
import com.neo.dto.AreaDto;
import com.neo.dto.ProvinceDto;
import com.neo.service.AreaService;
import com.neo.service.LawEnForCementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/api/law")
@Api(value = "执法", description = "执法", tags = "law")
public class LawController extends Base2Controller {
    @Autowired
    private LawEnForCementService lawEnForCementService;


    @Decrypt
    @Encrypt
    @GetMapping(value = "/selectAll")
    @ApiOperation(value = "查询所有执法信息", notes = "/selectAll", response = LawEnforcement.class)
    @ResponseBody
    public Map<String, Object> selectAll(@ApiParam("用户编号") @RequestParam(value = "userId") String userId,
                                           @ApiParam("token") @RequestParam(value = "token") String token) {
        if (isEnabled(userId, token)) {
            return tokenFail();
        }
        return sucess(lawEnForCementService.selectAll());
    }



}
